<template>
  <el-form-item label="值">
    <el-input v-if="isText" v-model="optionModel.widgetValue" type="text"></el-input>
    <el-input-number
      v-else
      v-model="optionModel.widgetValue"
      :min="optionModel.min"
      :max="optionModel.max"
      :precision="optionModel.dotNum"
      :step="1 / Math.pow(10, optionModel.dotNum)"
    ></el-input-number>
  </el-form-item>
</template>

<script>
export default {
  name: 'WidgetValueEditor',
  props: {
    designer: Object,
    selectedWidget: Object,
    optionModel: Object
  },
  computed: {
    isText() {
      return this.selectedWidget && this.selectedWidget.type === 'text'
    }
  }
}
</script>

<style lang="scss" scoped></style>
